package ace.module.mail.address.core.impl.dao.entity;

import jakarta.annotation.Nullable;
import io.swagger.v3.oas.annotations.media.Schema;

import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.experimental.SuperBuilder;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.data.annotation.CreatedDate;
import org.springframework.data.annotation.Id;
import org.springframework.data.annotation.LastModifiedDate;
import org.springframework.data.annotation.Version;
import org.springframework.data.relational.core.mapping.Table;
import jakarta.validation.constraints.Size;
import jakarta.validation.constraints.NotNull;
import jakarta.validation.constraints.NotEmpty;
import java.io.Serializable;
import ace.cmp.spring.data.jdbc.querydsl.core.annotations.LogicDelete;
import ace.cmp.spring.graphql.core.model.GenericPageContent;
import ace.module.mail.address.api.model.dto.MadMailAddressDto;

/**
* 邮寄地址.
*
* @author Caspar
*/
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
@Schema(title = MadMailAddressDto.TABLE_DESC)
@Table(MadMailAddressDto.TABLE_NAME)
public class MadMailAddress implements Serializable, GenericPageContent<Long> {

  @Id
  @Schema(title = MadMailAddressDto.ID_TITLE, description = MadMailAddressDto.ID_DESC)
  private Long id;

  @Schema(title = MadMailAddressDto.MAD_APP_ID_TITLE, description = MadMailAddressDto.MAD_APP_ID_DESC)
  private Long madAppId;

  @Schema(title = MadMailAddressDto.ACCOUNT_ID_TITLE, description = MadMailAddressDto.ACCOUNT_ID_DESC)
  private Long accountId;

  /**
   * {@link ace.module.mail.address.api.enums.MadMailAddressTypeEnum}
   */
  @Schema(title = MadMailAddressDto.TYPE_TITLE, description = MadMailAddressDto.TYPE_DESC)
  private Integer type;

  @Size(max = 255)
  @Schema(title = MadMailAddressDto.CONTACTS_TITLE, description = MadMailAddressDto.CONTACTS_DESC)
  private String contacts;

  @Size(max = 255)
  @Schema(title = MadMailAddressDto.CONTACT_PHONE_TITLE, description = MadMailAddressDto.CONTACT_PHONE_DESC)
  private String contactPhone;

  @Size(max = 255)
  @Schema(title = MadMailAddressDto.POST_CODE_TITLE, description = MadMailAddressDto.POST_CODE_DESC)
  private String postCode;

  @Size(max = 255)
  @Schema(title = MadMailAddressDto.COUNTRY_CODE_TITLE, description = MadMailAddressDto.COUNTRY_CODE_DESC)
  private String countryCode;

  @Size(max = 255)
  @Schema(title = MadMailAddressDto.COUNTRY_TITLE, description = MadMailAddressDto.COUNTRY_DESC)
  private String country;

  @Size(max = 255)
  @Schema(title = MadMailAddressDto.PROVINCE_CODE_TITLE, description = MadMailAddressDto.PROVINCE_CODE_DESC)
  private String provinceCode;

  @Size(max = 255)
  @Schema(title = MadMailAddressDto.PROVINCE_TITLE, description = MadMailAddressDto.PROVINCE_DESC)
  private String province;

  @Size(max = 255)
  @Schema(title = MadMailAddressDto.CITY_CODE_TITLE, description = MadMailAddressDto.CITY_CODE_DESC)
  private String cityCode;

  @Size(max = 255)
  @Schema(title = MadMailAddressDto.CITY_TITLE, description = MadMailAddressDto.CITY_DESC)
  private String city;

  @Size(max = 255)
  @Schema(title = MadMailAddressDto.AREA_CODE_TITLE, description = MadMailAddressDto.AREA_CODE_DESC)
  private String areaCode;

  @Size(max = 255)
  @Schema(title = MadMailAddressDto.AREA_TITLE, description = MadMailAddressDto.AREA_DESC)
  private String area;

  @Size(max = 255)
  @Schema(title = MadMailAddressDto.STREET_CODE_TITLE, description = MadMailAddressDto.STREET_CODE_DESC)
  private String streetCode;

  @Size(max = 255)
  @Schema(title = MadMailAddressDto.STREET_TITLE, description = MadMailAddressDto.STREET_DESC)
  private String street;

  @Size(max = 255)
  @Schema(title = MadMailAddressDto.ADDRESS_TITLE, description = MadMailAddressDto.ADDRESS_DESC)
  private String address;

  @Schema(title = MadMailAddressDto.DEFAULT_FLAG_TITLE, description = MadMailAddressDto.DEFAULT_FLAG_DESC)
  private Long defaultFlag;

  @Schema(title = MadMailAddressDto.SORT_TITLE, description = MadMailAddressDto.SORT_DESC)
  private Long sort;

  @LogicDelete
  @Schema(title = MadMailAddressDto.DELETE_FLAG_TITLE, description = MadMailAddressDto.DELETE_FLAG_DESC)
  private Long deleteFlag;

  @CreatedDate
  @Schema(title = MadMailAddressDto.CREATE_TIME_TITLE, description = MadMailAddressDto.CREATE_TIME_DESC)
  private Long createTime;

  @LastModifiedDate
  @Schema(title = MadMailAddressDto.UPDATE_TIME_TITLE, description = MadMailAddressDto.UPDATE_TIME_DESC)
  private Long updateTime;

  @Version
  @Schema(title = MadMailAddressDto.ROW_VERSION_TITLE, description = MadMailAddressDto.ROW_VERSION_DESC)
  private Long rowVersion;

}
